package utn.tsb.tsbxml;

import com.trolltech.qt.gui.*;

public class MainWindow extends QMainWindow {

    private CentralWidget centralWidget;

    public MainWindow(){
        this.setWindowTitle("TSB - XML Parser");
        this.setMinimumSize(700, 500);
        this.centralWidget = new CentralWidget();
        this.setCentralWidget(centralWidget);
        this.loadToolbar();
    }

    private void loadToolbar(){
        QToolBar toolbar = new QToolBar();
        QAction newFile = new QAction("New", this);
        QAction openFile = new QAction("Open", this);
        QAction saveFile = new QAction("Save", this);
        QAction closeFile = new QAction("Close", this);
        toolbar.addAction(newFile);
        toolbar.addAction(openFile);
        toolbar.addAction(saveFile);
        toolbar.addAction(closeFile);
        this.addToolBar(toolbar);

        newFile.triggered.connect(this.centralWidget, "newFile()");
        saveFile.triggered.connect(this.centralWidget, "saveFile()");
        openFile.triggered.connect(this.centralWidget, "openFile()");
        closeFile.triggered.connect(this.centralWidget, "closeFile()");
    }

}
